package cn.shyouchi.wuguanjia.android.ui.meetting;

import android.content.Intent;
import android.view.View;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;

import java.util.List;

import cn.shyouchi.wuguanjia.android.R;

/**
 * Created by Eenie on 2017/2/7 at 13:02
 * Email: 472279981@qq.com
 * Des:
 */

public class MeetModuleAdapter extends BaseQuickAdapter<MeetModule,BaseViewHolder> {
    public MeetModuleAdapter( List<MeetModule> data) {
        super(R.layout.item_meet_module_layout, data);

    }

    @Override
    protected void convert(BaseViewHolder holder, final MeetModule module) {

        holder.setImageResource(R.id.iv_module_ic, module.getIconRes());
        holder.setText(R.id.tv_module_name, module.getModuleName());

        holder.itemView.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                mContext.startActivity(new Intent(mContext, module.getTarget()));
            }
        });

    }
}
